<?php

namespace App\Http\Controllers;

use AipImageClassify;
use Illuminate\Http\Request;

class PlantDetectController extends AipImageClassifyController
{
    /**
     * Create a new controller instance.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function __invoke(Request $request)
    {

        $file = $request->file('image')->getRealPath();
        $result = $this->aip->plantDetect(file_get_contents($file));

        return $result;
    }
}
